import { Form } from 'ant-design-vue'
import { ref } from 'vue'

const { useForm } = Form

export function useDictTypeForm() {
  const show = ref(false)
  const loading = ref(false)
  const formModel = ref({
    dictName: '',
    dictType: '',
    status: '0',
    remark: ''
  } as ICreateDictTypeDTO)
  const formRules = ref({
    dictName: [{ required: true, message: '请输入字典名称' }],
    dictType: [{ required: true, message: '请输入字典类型' }]
  } as FormRules<ICreateDictTypeDTO>)

  const formRef = useForm(formModel, formRules)

  return {
    show,
    loading,
    formModel,
    formRef
  }
}
